package com.smh.a06exerciseDemo2;

import java.io.File;

public class Test2 {
    public static void main(String[] args) {

        File file = new File("day25-code\\src\\com\\smh\\File");
        System.out.println(contains(file, ".avi"));


    }

    public static boolean contains(File file, String str) {
        String[] list = file.list();
        for (String s : list) {
            if (s.endsWith(str)) {
                System.out.println(s);
                return true;
            }
        }
        return false;
    }
}
